package eu.vfs.localfile;

import java.io.File;

import eu.vfs.FileSystem;
import eu.vfs.VirtualFile;

public class LocalFS implements FileSystem{

	LocalFile root = null;
	
	VirtualFile mountPoint = null;
	
	public LocalFS(String path){
		root = new LocalFile(new File(path), null);
		root.setRoot(root);
		root.setParent(null);
	}
	
	@Override
	public VirtualFile getRootFile() {
		return root;
	}

	@Override
	public void notifyMounted(VirtualFile mountPoint) {
		root.setParent(mountPoint);
		this.mountPoint = mountPoint;
	}

	@Override
	public VirtualFile newFile(String path) {
		return new LocalFile(root.getFile().getAbsolutePath()+"/"+path, root);
	}

	@Override
	public VirtualFile findFile(String path) {
		// TODO Auto-generated method stub
		return null;
	}

}
